package com.yonyou.ncmm_pac_pda;

import com.yonyou.uap.um.application.ApplicationContext;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;

public abstract class PrintBTConnectActivity extends UMWindowActivity {

	protected UMWindow PrintBTConnect = null;
protected XVerticalLayout viewPage0 = null;
protected XHorizontalLayout navigatorbar0 = null;
protected UMButton button0 = null;
protected UMLabel label0 = null;
protected UMListViewBase listviewdefine0 = null;
protected XHorizontalLayout panel0 = null;
protected XHorizontalLayout panel1 = null;
protected UMLabel label4 = null;
protected XVerticalLayout panel2 = null;
protected UMLabel label5 = null;
protected UMLabel label6 = null;
protected UMLabel label1 = null;
protected UMButton button2 = null;
protected UMLabel label2 = null;
protected UMButton button3 = null;
protected UMLabel label3 = null;

	
	protected final static int ID_PRINTBTCONNECT = 249859315;
protected final static int ID_VIEWPAGE0 = 1173151189;
protected final static int ID_NAVIGATORBAR0 = 2080116073;
protected final static int ID_BUTTON0 = 553062160;
protected final static int ID_LABEL0 = 705888140;
protected final static int ID_LISTVIEWDEFINE0 = 718111936;
protected final static int ID_PANEL0 = 1286391955;
protected final static int ID_PANEL1 = 1200786732;
protected final static int ID_LABEL4 = 529654867;
protected final static int ID_PANEL2 = 579438302;
protected final static int ID_LABEL5 = 1327596107;
protected final static int ID_LABEL6 = 675531382;
protected final static int ID_LABEL1 = 1365032009;
protected final static int ID_BUTTON2 = 1223521350;
protected final static int ID_LABEL2 = 2049946503;
protected final static int ID_BUTTON3 = 428129831;
protected final static int ID_LABEL3 = 1698745573;

	
	
	@Override
	public String getControllerName() {
		return "PrintBTConnectController";
	}
	
	@Override
	public String getContextName() {
		return "";
	}

	@Override
	public String getNameSpace() {
		return "com.yonyou.ncmm_pac_pda";
	}

	protected void onCreate(Bundle savedInstanceState) {
		ULog.logLC("onCreate", this);
		super.onCreate(savedInstanceState);
        onInit(savedInstanceState);
        
	}
	
	@Override
	protected void onStart() {
		ULog.logLC("onStart", this);
		
		super.onStart();
	}

	@Override
	protected void onRestart() {
		ULog.logLC("onRestart", this);
		
		super.onRestart();
	}

	@Override
	protected void onResume() {
		ULog.logLC("onResume", this);
		
		super.onResume();
	}

	@Override
	protected void onPause() {
		ULog.logLC("onPause", this);
		
		super.onPause();
	}

	@Override
	protected void onStop() {
		ULog.logLC("onStop", this);
		
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		ULog.logLC("onDestroy", this);
		
		super.onDestroy();
	}
	
	public  void onInit(Bundle savedInstanceState) {
		ULog.logLC("onInit", this);
		UMActivity context = this;
		registerControl();
		this.getContainer();
		
		/*
		 new Thread() {
			 public void run() {
				 UMPDebugClient.startServer();
			 }
		 }.start();
		*/
		String sys_debug = ApplicationContext.getCurrent(this).getValue("sys_debug");
		if (sys_debug != null && sys_debug.equalsIgnoreCase("true")) {
			UMPDebugClient.waitForDebug();
		}

		IBinderGroup binderGroup = this;
		currentPage = getCurrentWindow(context, binderGroup);
super.setContentView(currentPage);

		
	}
	
	private void registerControl() {
		  idmap.put("PrintBTConnect",ID_PRINTBTCONNECT);
  idmap.put("viewPage0",ID_VIEWPAGE0);
  idmap.put("navigatorbar0",ID_NAVIGATORBAR0);
  idmap.put("button0",ID_BUTTON0);
  idmap.put("label0",ID_LABEL0);
  idmap.put("listviewdefine0",ID_LISTVIEWDEFINE0);
  idmap.put("panel0",ID_PANEL0);
  idmap.put("panel1",ID_PANEL1);
  idmap.put("label4",ID_LABEL4);
  idmap.put("panel2",ID_PANEL2);
  idmap.put("label5",ID_LABEL5);
  idmap.put("label6",ID_LABEL6);
  idmap.put("label1",ID_LABEL1);
  idmap.put("button2",ID_BUTTON2);
  idmap.put("label2",ID_LABEL2);
  idmap.put("button3",ID_BUTTON3);
  idmap.put("label3",ID_LABEL3);

	}
	
	public void onLoad() {
		ULog.logLC("onLoad", this);
		if(currentPage!=null) {
			currentPage.onLoad();
		}
	
		{ //viewPage0 - action:viewpage0_onload
    UMEventArgs args = new UMEventArgs(PrintBTConnectActivity.this);
    actionViewpage0_onload(viewPage0,args);

}

	}
	
	public void onDatabinding() {
		ULog.logLC("onDatabinding", this);
		super.onDatabinding();
		
	}
	
	@Override
	public void onReturn(String methodName, Object returnValue) {
		
	}

	@Override
	public void onAfterInit() {
		ULog.logLC("onAfterInit", this);
		
		onLoad();
	}
	
		@Override
	public Map<String,String> getPlugout(String id) {
		XJSON from = this.getUMContext();
		Map<String,String> r = super.getPlugout(id);
		
		return r;	
	}
	
	
	
	public View getNavigatorbar0View(final UMActivity context,IBinderGroup binderGroup) {
navigatorbar0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_NAVIGATORBAR0
,"color","#323232"
,"padding-left","8"
,"font-size","17"
,"valign","center"
,"title","蓝牙列表"
,"width","fill"
,"font-family","default"
,"background-image","navbar_login.png"
,"layout-type","vbox"
,"halign","LEFT"
,"padding-right","8"
,"height","44.0"
);
button0 = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTON0
,"font-pressed-color","#e50011"
,"color","#ffffff"
,"onclick","action:button0_onclick"
,"width","44"
,"font-size","20"
,"font-family","default"
,"valign","center"
,"background-image","icon_back.png"
,"layout-type","hbox"
,"halign","center"
,"height","44"
);
navigatorbar0.addView(button0);
label0 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL0
,"width","0"
,"weight","1"
,"valign","center"
,"font-family","default"
,"layout-type","hbox"
,"halign","center"
,"height","fill"
);
navigatorbar0.addView(label0);

return navigatorbar0;
}
public View getPanel2View(final UMActivity context,IBinderGroup binderGroup) {
panel2 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_PANEL2
,"width","0"
,"weight","2"
,"valign","TOP"
,"layout-type","hbox"
,"halign","center"
,"height","60.0"
);
label5 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL5
,"bindfield","bt_select"
,"color","#000000"
,"width","fill"
,"font-size","14"
,"weight","1"
,"valign","center"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"content","未连接"
,"height","0"
);
panel2.addView(label5);
label6 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL6
,"bindfield","bt_addr"
,"color","#000000"
,"width","fill"
,"font-size","14"
,"weight","1"
,"valign","center"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"content","设备地址"
,"height","0"
);
panel2.addView(label6);

return panel2;
}
public View getPanel1View(final UMActivity context,IBinderGroup binderGroup) {
panel1 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL1
,"width","fill"
,"valign","center"
,"layout-type","hbox"
,"halign","LEFT"
,"height","fill"
);
label4 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL4
,"bindfield","bt_name"
,"color","#000000"
,"width","0"
,"font-size","18"
,"weight","1"
,"valign","center"
,"font-family","default"
,"layout-type","hbox"
,"halign","right"
,"content","设备名称："
,"height","fill"
);
panel1.addView(label4);
View panel2 = (View) getPanel2View((UMActivity)context,binderGroup);
panel1.addView(panel2);

return panel1;
}
public View getPanel0View(final UMActivity context,IBinderGroup binderGroup) {
panel0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL0
,"border-bottom-color","#C7C7C7"
,"background","#FFFFFF"
,"border-bottom-width","1"
,"width","fill"
,"valign","center"
,"layout-type","vbox"
,"halign","LEFT"
,"height","60.0"
);
View panel1 = (View) getPanel1View((UMActivity)context,binderGroup);
panel0.addView(panel1);

return panel0;
}
public View getListviewdefine0View(final UMActivity context,IBinderGroup binderGroup) {
listviewdefine0 = (UMListViewBase)ThirdControl.createControl(new UMListViewBase(context),ID_LISTVIEWDEFINE0
,"layout","vbox"
,"bindfield","bluetooth"
,"collapsed","true"
,"width","fill"
,"weight","1"
,"valign","TOP"
,"onitemclick","action:listviewdefine0_onitemclick"
,"layout-type","vbox"
,"halign","center"
,"height","0"
);
listviewdefine0.addListItemView("getPanel0View");

return listviewdefine0;
}
public View getViewPage0View(final UMActivity context,IBinderGroup binderGroup) {
viewPage0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGE0
,"background","#F5F5F5"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"onload","action:viewpage0_onload"
,"height","fill"
);
View navigatorbar0 = (View) getNavigatorbar0View((UMActivity)context,binderGroup);
viewPage0.addView(navigatorbar0);
View listviewdefine0 = (View) getListviewdefine0View((UMActivity)context,binderGroup);
viewPage0.addView(listviewdefine0);
label1 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL1
,"color","#000000"
,"width","fill"
,"font-size","14"
,"valign","center"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"content","未连接蓝牙设备"
,"height","50"
);
viewPage0.addView(label1);
button2 = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTON2
,"font-pressed-color","#f2adb2"
,"color","#ffffff"
,"onclick","action:button2_onclick"
,"font-size","17"
,"valign","center"
,"margin-right","10"
,"margin-left","10"
,"background","#ff0000"
,"width","fill"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"value","获取蓝牙列表"
,"height","44"
);
viewPage0.addView(button2);
label2 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL2
,"color","#000000"
,"width","fill"
,"font-size","14"
,"valign","center"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"height","20"
);
viewPage0.addView(label2);
button3 = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BUTTON3
,"font-pressed-color","#f2adb2"
,"color","#ffffff"
,"onclick","action:button3_onclick"
,"font-size","17"
,"valign","center"
,"margin-right","10"
,"margin-left","10"
,"background","#ff0000"
,"width","fill"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"value","条码打印"
,"height","44"
);
viewPage0.addView(button3);
label3 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL3
,"color","#000000"
,"width","fill"
,"font-size","14"
,"valign","center"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"height","20"
);
viewPage0.addView(label3);

return viewPage0;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup) {
PrintBTConnect = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_PRINTBTCONNECT
,"layout","vbox"
,"controller","PrintBTConnectController"
,"namespace","com.yonyou.ncmm_pac_pda"
,"width","fill"
,"valign","TOP"
,"layout-type","linear"
,"halign","center"
,"height","fill"
);
View viewPage0 = (View) getViewPage0View((UMActivity)context,binderGroup);
PrintBTConnect.addView(viewPage0);

return (UMWindow)PrintBTConnect;
}

	
	public void actionListviewdefine0_onitemclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "listviewdefine0_onitemclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.listItemCLick()",UMActivity.getViewId(control),args);
}
public void actionButton2_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "button2_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.button2_onclick()",UMActivity.getViewId(control),args);
}
public void actionButton3_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "button3_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.button3_onclick()",UMActivity.getViewId(control),args);
}
public void actionViewpage0_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "viewpage0_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.viewonload()",UMActivity.getViewId(control),args);
}
public void actionButton0_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "button0_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.button0_onclick()",UMActivity.getViewId(control),args);
}


}
